import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "./assets/js/rem"
// 滚动条样式
import './assets/css/scroll.less';
import ElementPlus from 'element-plus';
// import locale from 'element-plus/lib/locale/lang/zh-cn';//element-plus 中文
import scroll from "./assets/js/scroll" //隐藏-显示滚动条

import QiaoNan from 'qiaonan'

// 基础路径
import $http from './api/index'
let condition = process.env.NODE_ENV
console.log("环境模式和地址：", condition, process.env.VUE_APP_URL)//请求地址

let app = createApp(App);
// 设置全局变量或方法
app.config.globalProperties.$http = $http; //
app.config.globalProperties.$set = (obj, key, value) => {
    obj[key] = value;
}
app.use(store).use(router).use(ElementPlus,/* {locale } */).use(scroll).use(QiaoNan).mount('#app');

const is_production = process.env.NODE_ENV == 'bformal' || process.env.NODE_ENV == 'btest' || process.env.NODE_ENV == 'blocal';

if (is_production) {
    window.cl = function () { }
    console.log = function() { }
} else {
    // 重写console.log
    window.cl = function (...args) {
        return console.log.bind(null, ...args);
    }()
}

